package instruments;

import collision.MainWindow;
import data.InstrumentGraphics;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.MouseEvent;

/**
 * @author sad
 */
public abstract class Instrument {

    
    public void redraw(){
        MainWindow.getInstance().getDrawField().redraw();
    }
    public void mouseMove(int x, int y, int oldX, int oldY){}

    public void mouseDown(int x, int y, int modifiers){}

    public void mouseClick(int x, int y, int modifiers){}

    public void mouseUp(int x, int y, int modifiers){}

    public void initInstrument() {
    }

    public void closeInstrument() {
    }

    protected boolean isLeftDown(int modifiers) {
        return (modifiers & MouseEvent.BUTTON1_DOWN_MASK) != 0;
    }

    protected boolean isRightDown(int modifiers) {
        return (modifiers & MouseEvent.BUTTON3_DOWN_MASK) != 0;
    }

    public void onDraw(InstrumentGraphics g) {
    }
}
